package com.newMedical.medicine.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.newMedical.medicine.mapper.YpPrescriptionMapper;
import com.newMedical.medicine.domain.YpPrescription;
import com.newMedical.medicine.service.IYpPrescriptionService;

/**
 * 处方Service业务层处理
 * 
 * @author zhou
 * @date 2021-12-03
 */
@Service
public class YpPrescriptionServiceImpl implements IYpPrescriptionService 
{
    @Autowired
    private YpPrescriptionMapper ypPrescriptionMapper;

    /**
     * 查询处方
     * 
     * @param id 处方主键
     * @return 处方
     */
    @Override
    public YpPrescription selectYpPrescriptionById(Long id)
    {
        return ypPrescriptionMapper.selectYpPrescriptionById(id);
    }

    /**
     * 查询处方列表
     * 
     * @param ypPrescription 处方
     * @return 处方
     */
    @Override
    public List<YpPrescription> selectYpPrescriptionList(YpPrescription ypPrescription)
    {
        return ypPrescriptionMapper.selectYpPrescriptionList(ypPrescription);
    }

    /**
     * 新增处方
     * 
     * @param ypPrescription 处方
     * @return 结果
     */
    @Override
    public int insertYpPrescription(YpPrescription ypPrescription)
    {
        return ypPrescriptionMapper.insertYpPrescription(ypPrescription);
    }

    /**
     * 修改处方
     * 
     * @param ypPrescription 处方
     * @return 结果
     */
    @Override
    public int updateYpPrescription(YpPrescription ypPrescription)
    {
        return ypPrescriptionMapper.updateYpPrescription(ypPrescription);
    }

    /**
     * 批量删除处方
     * 
     * @param ids 需要删除的处方主键
     * @return 结果
     */
    @Override
    public int deleteYpPrescriptionByIds(Long[] ids)
    {
        return ypPrescriptionMapper.deleteYpPrescriptionByIds(ids);
    }

    /**
     * 删除处方信息
     * 
     * @param id 处方主键
     * @return 结果
     */
    @Override
    public int deleteYpPrescriptionById(Long id)
    {
        return ypPrescriptionMapper.deleteYpPrescriptionById(id);
    }
}
